All Questions
Tagged with interview-questionsstrings
102 questions
4votes
4answers
182views
Reversing string in PHP
I got this task to evaluate my knowledges in PHP. I was asked to avoid using functions like strrev() or array_reverse(). ...
5votes
1answer
250views
String character changes (case insensitive) - Go
I saw this question on one of the socials, presented as an Apple interview question. I have had to paraphrase as it was not given in text format. (Credit: Instagram @greghogg5) Given a string (S) ...
4votes
6answers
1kviews
Reverse string with identical spaces as in original String using Java
This is interview question Reverse string with identical spaces as in original String using Java For example Original String : best in the world and is greatest and is making sure the world goes well ...
2votes
1answer
158views
Golang solution to CTCI 1.2: Check whether two strings are permutations of each other
Just started learning Go recently. Did some questions from Cracking the Coding Interview book. Wrote the solutions in Go. Let me know what you think. https://github.com/samjingwen/ctci Below is ...
2votes
3answers
1kviews
Find the 'n' most frequent words in a text, aka word frequency
I'm doing freeCodeCamp's Coding Interview Prep to improve my JavaScript skills. This challenge is called "Word Frequency", and is based on the Rosetta Code's entry of the same name. The ...
2votes
2answers
985views
InterviewBit Problem: Stringoholics
I am trying to solve this InterviewBit problem. Problem Statement: You are given an array A consisting of strings made up of the letters ‘a’ and ‘b’ only. Each string goes through a number of ...
4votes
1answer
506views
strstr implementation with python and sets
Please review my strstr implementation in terms of time/space efficiency and overall readability. I am preparing for a coding assessment coming up as I am looking to pivot my career from Physics to ...
4votes
3answers
618views
Microsoft OA | Longest Substring Without 3 Contiguous Occurrences of Letter
For the following question, does my JS Solution seem correct? I'm looking for some peer review. Q: Given a string s containing only a and b, find longest substring of s such that s does not contain ...
7votes
4answers
3kviews
How can I efficiently manipulate digits in a string without using RegEx in Java?
I am reading a book with different quizzes about coding interviews. Please implement a function that increments a string based on the rules below: It should take the string of unknown length and ...
4votes
3answers
695views
Checking if a string contains all unique characters
I am currently reviewing CTCI(Cracking the Coding Interview) The question is asking me to implement an algorithm which checks whether the characters in a string are all unique however they do not want ...
2votes
1answer
839views
LeetCode: Greatest Common Divisor of Strings C#
https://leetcode.com/problems/greatest-common-divisor-of-strings/ For strings S and T, we say "T divides S" if and only if S = T + ... + T (T concatenated with itself 1 or more times) Return ...
3votes
1answer
116views
CareerCup (Bloomberg): Check if string is valid based on brackets
The goal of this problem is to determine if a string with brackets is valid. Below is a summary of the question from careercup. Check if string s is valid based on brackets ...
6votes
3answers
370views
Leetcode - First Unique Character in a String
Given a string, find the first non-repeating character in it and return its index. If it doesn't exist, return -1. Examples: ...
2votes
1answer
261views
Simple pattern matching between two string inputs using Java (Google interview challenge)
The interview question is: Write a function isMatch (without using java.util.Regex) that takes two strings as arguments: ...
1vote
2answers
334views
Count Substrings for a binary string
Problem is taken from leet code. Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings ...